all: orsa
	mkdir -p bin; mv orsa bin/; mv main.o bin/

%.o: %.cpp
	g++ -c -O2 -Wall -Wextra -pedantic -lboost_thread -lpthreads $<

library-objects = \
	bin/BigUnsigned.o \
	bin/BigInteger.o \
	bin/BigIntegerAlgorithms.o \
	bin/BigUnsignedInABase.o \
	bin/BigIntegerUtils.o \
	bin/Prime.o \
	bin/NumCores_Linux.o \
	bin/o-RSA.o \

orsa: main.o $(library-objects)
	g++ $^ -lpthread -lboost_thread -o $@

main.o: main.cpp $(library-objects)

$(library-objects):
	cd o-RSA; make

clean:
	rm bin/orsa bin/main.o; cd o-RSA; make clean
